package com.example.xxpk.controller.userenergys;

import com.example.xxpk.common.result.R;
import com.example.xxpk.pojo.UserEnergys;
import com.example.xxpk.service.userenergys.IUserEnergysService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2025-02-22
 */
@RestController
@RequestMapping("/userEnergys")
@RequiredArgsConstructor
@Api(tags="获取体力")
public class UserEnergysController {

    private final IUserEnergysService userEnergysService;

    // 获取可用的装扮信息
    @GetMapping("/addEnergys")
    @ApiOperation("获得体力")
    public R getOutfitInfo(@RequestParam Integer userId, @RequestParam Integer type) {
        UserEnergys userEnergys = userEnergysService.addEnergys(userId,type);
        return R.data("今日次数",userEnergys.getCount());
    }
}
